<%--
  Created by IntelliJ IDEA.
  User: jackiechan
  Date: 2021/8/31
  Time: 10:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <%
        request.setAttribute("name", "zhangsan");//设置属性
        pageContext.setAttribute("pagecontext","wo ye bu zhi dao shi shen me ,fan zheng jiu shi ce shi yi xia ");
        session.setAttribute("sessionname", "meitianshuijiaohezaoshangqichuangjiuyaocabiti");
        application.setAttribute("applicationname", "zuotiankanqunliyougexueshengshangbanshitianleyihangdaimadouhaimeikaishixie,yinweishitianlequanxianhaimeigeitafenpei");

        String name =(String)request.getAttribute("name");
        String pagecontextValue =  (String)pageContext.getAttribute("pagecontext");
//这里向 session 保存的数据在其他的 jsp 可以取出来
        String sessionnameValue =  (String)session.getAttribute("sessionname");

        String applicationValue =  (String)application.getAttribute("applicationname");
<%--    //输出内容.不需要再用<%= 来输出%>--%>
        out.print("这是输出的内容");
    %>


<%= name%><br>

<%= pagecontextValue%><br>

<%= sessionnameValue%><br>

<%= applicationValue%><br>
<%--
<%=  是输出语法,需要有内容才可以输出,如果在里面写 out.print 这个 方法的返回值是 void,所以无法输出,会导致解析异常
out.print 本身就是输出操作,不需要写在输出语法中

--%>
    <%--<%= out.print("zheshi out shu chu de neirong")%>--%>

</body>
</html>
